<%@page import="java.util.Date" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/static/bootstrap/bootstrap-3.3.7-dist/css/bootstrap.css" rel="stylesheet">
    <script src="/static/bootstrap/bootstrap-3.3.7-dist/js/bootstrap.js"></script>
    <script type="text/javascript" src="/static/js3/jQuery-2.1.4/jquery-2.1.4.min.js"></script>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>叩丁狼客户管理系统->用户登录</title>
    <link rel="stylesheet" href="/css/core.css" type="text/css"/>
    <script>
        $(function () {
            $('#btn').click(function () {
                var value = 0;
                var time1 = setInterval(function () {
                    value += 1;
                    $('#progress-bar').html(value + '%');
                    $('#progress-bar').css("width", value + '%');
                    if (value == 100) {
                        clearInterval(time1);
                        document.forms[0].submit();
                    }
                }, 50);
            })
        })
    </script>
    <script>
        $(function () {
            $('#btnsubmit').click(function () {
                $.post('/login.do',$('#loginForm').serialize(),function (data) {
                    if (data.success){
                        location.href='/employee/list.do';
                    }else {
                        alert(data.msg)
                    }
                })
            })
        })
    </script>
    <style type="text/css">
        body {
            background-color: #FFFFFF;
        }

        .cm-container {
            margin-top: 160px;
        }

        .login {
            width: 360px;
            height: 300px;
            margin: 0px auto;
        }
    </style>


</head>
<body>
<div class="container cm-container">
    <h3 class="text-center"><font style="color: #337ab7;">叩丁狼客户管理系统(系统管理平台)</font></h3>
    <hr/>
    <div class="login">
        <span style="color: red;">${errorMsg}</span>
        <form id="loginForm" action="/login.do" method="post">
            <div class="form-group form-group-lg">
                <div class="input-group">
                    <div class="input-group-addon">用户名</div>
                    <input class="form-control" name="username" value="${cookie.username.value}"/>
                </div>
            </div>
            <div class="form-group form-group-lg">
                <div class="input-group">
                    <div class="input-group-addon">密&emsp;码</div>
                    <input class="form-control" name="password" type="password" value="${cookie.password.value}"/>
                </div>
            </div>

            <div class="form-group form-group-lg">
                <div class="input-group">
                    <div class="input-group-addon">验证码</div>
                    <input class="form-control" name="randomCode" type="text" style="width: 200px"/>
                    <img alt="" src="/randomCode" id="randomCode">
                    <script type="text/javascript">
                        document.getElementById("randomCode").onclick = function () {
                            this.src = "/randomCode?" + new Date().getTime();
                        }
                    </script>
                    <!-- <a href="/login.jsp">
                    <img alt="" src="/randomCode">
                    </a> -->

                </div>
            </div>

            <div class="form-group form-group-lg">
                <div class="input-group">
                    <div>记住我
                        <input name="rememberMe" type="checkbox"/>
                    </div>
                </div>
                <div class="form-group">
                    <button type="submit" class="btn btn-lg btn-primary btn-block" id="btn_submit">快捷登录</button>
                    <button  class="btn btn-lg btn-primary btn-block" id="btnsubmit">快捷登录1</button>
                    (充值会员后可用)
                </div>
        </form>
    </div>
</div>
普通登录
<button id="btn" class="btn-success">登录</button>
<div class="progress">
    <div id="progress-bar" class="progress-bar progress-bar-striped progress-bar-success active" role="progressbar"
         aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
        <span class="sr-only">0 Complete</span>
    </div>
</div>
</body>
</html>